#ifndef __DATA_PROCESS_H__
#define __DATA_PROCESS_H__
#pragma once

struct STErrorInfo;

struct STDataItemInfo
{
	std::string cmd;
	std::string timestamp;
	std::string id;
	std::string title;
	std::string body;
};

struct STDataProcessRequest
{
	std::string appname;
	std::string action;
	std::string table_name;
	std::vector<STDataItemInfo> items;
};

struct STDataProcessResponse
{
	std::vector<STErrorInfo> errorList;
	std::string status;
	std::string request_id; 
};

class DLL_OPENSEARCH_API CDataProcess
{
public:
	static CDataProcess* getInstance();

	bool Initialize(std::string host);
	bool Destory();

	STDataProcessResponse* dataProcess(STDataProcessRequest *pRequest);
	bool parsedataProcessResponse();

	STDataProcessResponse m_dataProcessResponse;
	std::string m_strUrl;
	std::map<std::string, std::string> m_mapRequestParameter;
	std::vector<std::string> m_vecRequestParameter;
private:
	CDataProcess();
	~CDataProcess();
};


#endif // !__DATA_PROCESS_H__
